<div id="invoices_list">

<div id="right-side">


<table width="750" border="0" cellpadding="0" cellspacing="0" id="table-stadistic">
  <thead>
    <tr>
      <th width="350">Location</th>
      <th>Month</th>
      <th width="100">Last Month Recyc</th>
      <th width="100">Last Month Trash Amt</th>
      <th width="100">Last 3 Mo Recy</th>
      <th width="100">Last 3 Mo</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($locations as $location): ?>
      <tr>
      <td><?php echo $location->getServiceAddress() ?></td>
      <td>January</td>
      <td><?php echo number_format($location->getLastMonthsTons(1,"Recycle"),2,'.',','); //echo /Invoice::getLastMonthsTons($location->getAccountId(),1,"Recycle")->getSuma(); echo implode(',',Invoice::getInvoicesIds($location->getAccountId())); ?></td>
      <td><?php echo number_format($location->getLastMonthsTons(1,"Trash"),2,'.',','); ?></td>
      <td><?php echo number_format($location->getLastMonthsTons(3,"Recycle"),2,'.',','); ?></td>
      <td><?php echo number_format($location->getLastMonthsTonsTotal(),2,'.',','); ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
</div>
<div class="pagination">
  <?php if ($pager->haveToPaginate()): ?>

    <?php if (!$pager->isFirstPage()) :  ?>
      <a onclick="paginateLocations(1)" style="cursor:pointer"><?php echo 'First' ?></a>

      <span class="imag"><img src="/images/anterior_ico.gif" width="7" height="8" alt="" /></span>
      <a onclick="paginateLocations(<?php echo $pager->getPreviousPage() ?>)" style="cursor:pointer"><?php echo 'Previous' ?></a>
    <?php endif; ?>

    <?php foreach ($pager->getLinks() as $page): ?>
      <?php if ($page == $pager->getPage()): ?>
        <?php echo $page ?>
      <?php else: ?>
      <a onclick="paginateLocations(<?php echo $page ?>)" style="cursor:pointer"><?php echo $page ?></a>
      <?php endif; ?>
    <?php endforeach; ?>

    <?php if (!$pager->isLastPage()) :  ?>
      <a onclick="paginateLocations(<?php echo $pager->getNextPage() ?>)" style="cursor:pointer"> <?php echo 'Next' ?></a>  <span class="imag"><img src="/images/siguiente_ico.gif" width="7" height="8" alt="" /></span>

      <a onclick="paginateLocations(<?php echo $pager->getLastPage() ?>)" style="cursor:pointer"><?php echo 'Last' ?></a>
    <?php endif; ?>

  <?php endif; ?>

</div>
   
</div>